import sys
from iaxclient import IAXClient

if __name__ == '__main__':
  voip = IAXClient(ringin=True, ringout=True, debug=True)
  voip.start("mike" , "iax.provider.com", "1234", iaxpw=None, port=4569, callername="Wphoniax", callernum="0000")
  sys.stdout.write("Calltest - press q or ^C to quit.\n\n")
  sys.stdout.flush()
  while True:
    try:
      rawcmd = raw_input("> ")
      cmd = rawcmd.strip()
      if cmd == 'q':
        break
      else:
        voip.send_and_play_dtmfs(cmd)
    except KeyboardInterrupt:
      break
voip.hangup()
sys.exit(0)

